﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Medianamik.Core.Interfaces;

namespace Medianamik.Core.Syndication
{
    public class SyndicationNodeDictionary : Dictionary<Guid,List<Guid>> , ISyndicationNodeDictionary 
    {
        public SyndicationNodeDictionary(IDictionary<Guid, List<Guid>> pValues)
            : base(pValues)
        { }

        public Guid[] GetSyndicationNodeIds(Guid pContentNodeId)
        {
            if(ContainsKey(pContentNodeId ))
            {
                return this[pContentNodeId].ToArray(); 
            }
            return new Guid[0];
        }

        public bool HasSyndicationNodeIds(Guid pContentNodeId)
        {
            return ContainsKey(pContentNodeId)
                && this[pContentNodeId].Count > 0;
        }
    }
}
